package com.maozi.system.permission.api.rest.v1.platform;

import java.util.List;

import javax.validation.Valid;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.maozi.common.result.AbstractBaseResult;
import com.maozi.system.permission.vo.v1.platform.PermissionDropDownResult;
import com.maozi.system.permission.vo.v1.platform.PermissionInfoVo;
import com.maozi.system.permission.vo.v1.platform.PermissionListVo;
import com.maozi.user.permission.dto.v1.platform.PermissionSaveUpdateParam;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "【平台】【V1】权限模块")
@RequestMapping("/permission/platform/v1")
public interface RestPermissionServiceV1 {
	
	@GetMapping(value="/list")
	@Operation(summary = "列表")
//	@PreAuthorize("hasAuthority('system:permission:list')")
	AbstractBaseResult<List<PermissionListVo>> restList();
	
	@PostMapping(value="/save")
	@Operation(summary = "保存")
//	@PreAuthorize("hasAuthority('system:permission:save')")
	AbstractBaseResult<Long> restSave(@RequestBody @Valid PermissionSaveUpdateParam param);
	
	@GetMapping(value="/dropDownList")
	@Operation(summary = "下拉列表")
//	@PreAuthorize("hasAuthority('system:permission:save') or hasAuthority('system:permission:update')")
	AbstractBaseResult<List<PermissionDropDownResult>> dropDownListResultCustomize();
	
	@Tag(name = "【平台】【V1】权限模块")
	@RequestMapping("/permission/platform/v1/{id}")
	public interface RestPermissionServiceCurrentV1 {
		
		@GetMapping(value="/get")
		@Operation(summary = "详情")
//		@PreAuthorize("hasAuthority('system:permission:get')")
		AbstractBaseResult<PermissionInfoVo> restGet(@PathVariable Long id);
		
		@PostMapping(value="/remove")
		@Operation(summary = "删除")
//		@PreAuthorize("hasAuthority('system:permission:remove')")
		AbstractBaseResult<Void> restRemove(@PathVariable Long id);
		
		@PostMapping(value="/update")
		@Operation(summary = "更新")
//		@PreAuthorize("hasAuthority('system:permission:update')")
		AbstractBaseResult<Void> restUpdate(@PathVariable Long id,@RequestBody PermissionSaveUpdateParam param);
		
	}

}